/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pprogbar.cpp - PegProgressBar class.
//
// Author: Kenneth G. Maxwell
//
// Copyright (c) 1997-2000 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PP_BAR_
#define _PP_BAR_

class PegProgressBar : public PegTextThing
{
    public:
        PegProgressBar(const PegRect &Rect,
                       PEGULONG Style = FF_THIN|PS_SHOW_VAL|PS_PERCENT, 
                       PEGINT Min = 0, PEGINT Max = 100, PEGINT Current = 0);

        virtual void Draw(const PegRect &Invalid);
        PegButton *GetButton() {return mpButton;}
        virtual void ParentShift(PEGINT x, PEGINT y);
        void Reconfig(PEGULONG Style, PEGINT Min, PEGINT Max);
        virtual void Resize(const PegRect &Size);
        virtual void SetColor(const PEGUBYTE Index, const PEGUINT ColorId);

        void Update(PEGINT Val);
        PEGINT Value(void) {return mCurrent;}

    protected:
        void GetButtonRect(void);

       #ifdef PEG_PRO
        PegGradientStruct mGrad;
       #endif

        PegRect   mButtonRect;
        PegButton *mpButton;
        PEGINT    mMin;
        PEGINT    mMax;
        PEGINT    mCurrent;

};


#endif


